Fix for resize bug. Call gtk_widget_size_allocate instead of
authorLars Hamann <lars@gtk.org>
Mon, 10 Aug 1998 17:56:43 +0000 (17:56 +0000)
committerLars Hamann <lars@src.gnome.org>
Mon, 10 Aug 1998 17:56:43 +0000 (17:56 +0000)
Sun Aug  9 23:31:59 1998  Lars Hamann  <lars@gtk.org>

        * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call
        gtk_widget_size_allocate instead of gtk_widget_queue_resize
        if the visibility state of a scrollbar changes.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkclist.c

index 0a202c477f1677a1d59c59b9118e1d622f38119a..065a49e7e2c3f990c5e45f00f76e64486e2bb6a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun Aug  9 23:31:59 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call
+       gtk_widget_size_allocate instead of gtk_widget_queue_resize
+       if the visibility state of a scrollbar changes.
+
 Mon Aug 10 12:49:54 1998  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkhbbox.h: fixed an #include statement (reported by Eric Kidd).
index 0a202c477f1677a1d59c59b9118e1d622f38119a..065a49e7e2c3f990c5e45f00f76e64486e2bb6a9 100644 (file)
@@ -1,3 +1,9 @@
+Sun Aug  9 23:31:59 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call
+       gtk_widget_size_allocate instead of gtk_widget_queue_resize
+       if the visibility state of a scrollbar changes.
+
 Mon Aug 10 12:49:54 1998  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkhbbox.h: fixed an #include statement (reported by Eric Kidd).
index 0a202c477f1677a1d59c59b9118e1d622f38119a..065a49e7e2c3f990c5e45f00f76e64486e2bb6a9 100644 (file)
@@ -1,3 +1,9 @@
+Sun Aug  9 23:31:59 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call
+       gtk_widget_size_allocate instead of gtk_widget_queue_resize
+       if the visibility state of a scrollbar changes.
+
 Mon Aug 10 12:49:54 1998  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkhbbox.h: fixed an #include statement (reported by Eric Kidd).
index 0a202c477f1677a1d59c59b9118e1d622f38119a..065a49e7e2c3f990c5e45f00f76e64486e2bb6a9 100644 (file)
@@ -1,3 +1,9 @@
+Sun Aug  9 23:31:59 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call
+       gtk_widget_size_allocate instead of gtk_widget_queue_resize
+       if the visibility state of a scrollbar changes.
+
 Mon Aug 10 12:49:54 1998  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkhbbox.h: fixed an #include statement (reported by Eric Kidd).
index 0a202c477f1677a1d59c59b9118e1d622f38119a..065a49e7e2c3f990c5e45f00f76e64486e2bb6a9 100644 (file)
@@ -1,3 +1,9 @@
+Sun Aug  9 23:31:59 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call
+       gtk_widget_size_allocate instead of gtk_widget_queue_resize
+       if the visibility state of a scrollbar changes.
+
 Mon Aug 10 12:49:54 1998  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkhbbox.h: fixed an #include statement (reported by Eric Kidd).
index 0a202c477f1677a1d59c59b9118e1d622f38119a..065a49e7e2c3f990c5e45f00f76e64486e2bb6a9 100644 (file)
@@ -1,3 +1,9 @@
+Sun Aug  9 23:31:59 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call
+       gtk_widget_size_allocate instead of gtk_widget_queue_resize
+       if the visibility state of a scrollbar changes.
+
 Mon Aug 10 12:49:54 1998  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkhbbox.h: fixed an #include statement (reported by Eric Kidd).
index 0a202c477f1677a1d59c59b9118e1d622f38119a..065a49e7e2c3f990c5e45f00f76e64486e2bb6a9 100644 (file)
@@ -1,3 +1,9 @@
+Sun Aug  9 23:31:59 1998  Lars Hamann  <lars@gtk.org>
+
+       * gtk/gtkclist.c (adjust_scrollbars): Fix for resize bug. Call
+       gtk_widget_size_allocate instead of gtk_widget_queue_resize
+       if the visibility state of a scrollbar changes.
+
 Mon Aug 10 12:49:54 1998  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkhbbox.h: fixed an #include statement (reported by Eric Kidd).
index 5f89745c24841f5ec1db1eac33b3040ae92a3572..03290d694e6f108f4d03553edbb423a8900ab856 100644 (file)
@@ -2759,24 +2759,25 @@ gtk_clist_button_press (GtkWidget * widget,
   for (i = 0; i < clist->columns; i++)
     if (clist->column[i].window && event->window == clist->column[i].window)
       {
-       if (!GTK_WIDGET_HAS_FOCUS (widget))
-         gtk_widget_grab_focus (widget);
-
-       GTK_CLIST_SET_FLAG (clist, CLIST_IN_DRAG);
-       gtk_widget_get_pointer (widget, &clist->x_drag, NULL);
-
        gdk_pointer_grab (clist->column[i].window, FALSE,
                          GDK_POINTER_MOTION_HINT_MASK |
                          GDK_BUTTON1_MOTION_MASK |
                          GDK_BUTTON_RELEASE_MASK,
                          NULL, NULL, event->time);
        gtk_grab_add (widget);
+       GTK_CLIST_SET_FLAG (clist, CLIST_IN_DRAG);
+
+       if (!GTK_WIDGET_HAS_FOCUS (widget))
+         gtk_widget_grab_focus (widget);
+
+       clist->drag_pos = i;
+       clist->x_drag = (COLUMN_LEFT_XPIXEL(clist, i) + COLUMN_INSET +
+                        clist->column[i].area.width + CELL_SPACING);
 
        if (GTK_CLIST_ADD_MODE (clist))
          gdk_gc_set_line_attributes (clist->xor_gc, 1, GDK_LINE_SOLID, 0, 0);
-
        draw_xor_line (clist);
-       clist->drag_pos = i;
+
        return FALSE;
       }
 
@@ -3274,9 +3275,7 @@ gtk_clist_size_allocate (GtkWidget * widget,
   
   /* column button allocation */
   size_allocate_columns (clist);
-
-  if (GTK_WIDGET_REALIZED (widget))
-    size_allocate_title_buttons (clist);
+  size_allocate_title_buttons (clist);
 
   adjust_scrollbars (clist);
   
@@ -4287,7 +4286,8 @@ adjust_scrollbars (GtkCList * clist)
       if (GTK_WIDGET_VISIBLE (clist->vscrollbar))
        {
          gtk_widget_hide (clist->vscrollbar);
-         gtk_widget_queue_resize (GTK_WIDGET (clist));
+         gtk_widget_size_allocate (GTK_WIDGET (clist),
+                                   &GTK_WIDGET (clist)->allocation);
        }
     }
   else
@@ -4295,7 +4295,8 @@ adjust_scrollbars (GtkCList * clist)
       if (!GTK_WIDGET_VISIBLE (clist->vscrollbar))
        {
          gtk_widget_show (clist->vscrollbar);
-         gtk_widget_queue_resize (GTK_WIDGET (clist));
+         gtk_widget_size_allocate (GTK_WIDGET (clist),
+                                   &GTK_WIDGET (clist)->allocation);
        }
     }
 
@@ -4305,7 +4306,8 @@ adjust_scrollbars (GtkCList * clist)
       if (GTK_WIDGET_VISIBLE (clist->hscrollbar))
        {
          gtk_widget_hide (clist->hscrollbar);
-         gtk_widget_queue_resize (GTK_WIDGET (clist));
+         gtk_widget_size_allocate (GTK_WIDGET (clist),
+                                   &GTK_WIDGET (clist)->allocation);
        }
     }
   else
@@ -4313,7 +4315,8 @@ adjust_scrollbars (GtkCList * clist)
       if (!GTK_WIDGET_VISIBLE (clist->hscrollbar))
        {
          gtk_widget_show (clist->hscrollbar);
-         gtk_widget_queue_resize (GTK_WIDGET (clist));
+         gtk_widget_size_allocate (GTK_WIDGET (clist),
+                                   &GTK_WIDGET (clist)->allocation);
        }
     }